{include file="public/nheader" /}
<div class="layui-fluid">
    <div class="layui-card">
        <!-- // 创建数据实例 -->
        <table id="lay-tableList" lay-filter="lay-tableList"></table>
    </div>
</div>
{include file="public/nfooter"}
<script>
    layui.use(['table'], function () {
        var table = layui.table;
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList",
            where: {
                agentid: "{:input('agentid/d',0)}",
                types: "{:input('types/d',0)}"
            }
            , url: "{:url()}"
            ,toolbar: 'true'
            , limits: [10, 20, 40, 60, 80, 100, 150, 200, 300,1000,10000]
            , page: true
            , size: 'lg'
            , even: true
            , cols: [[
                { field: 'id', align: 'center', sort: true, width: 80, title: 'ID' },
                // { field: 'timeid', align: 'center', width: 120, title: '编号' },
                { field: 'befores', width: 150, align: 'center', title: '交易前金额' },
                { field: 'money', width: 150, align: 'center', title: '交易金额' },
                { field: 'after', width: 150, align: 'center', title: '交易后金额' },
                { field: 'info', width: 150, align: 'center', title: '备注' },
                {
                    field: 'source', align: 'center', width: 100, templet: function (d) {
                        if (d.type == 1) {
                            return '<a style="color:blue" class="layui-table-text" lay-open data-title="订单" data-area="90%,90%" data-url="/orders/order_edit?id=' + d.source + '" >' + d.source + '</a>';
                        } else {
                            return d.source;

                        }
                    }, title: '来自订单ID'
                },
                { field: 'ordername', width: 200, align: 'center', title: '下单人' },
                { field: 'ordermobile', width: 200, align: 'center', title: '下单人联系电话' },
                { field: 'ordercreated', width: 200, align: 'center', title: '下单时间' },
                // { field: 'source', width: 150, align: 'center', title: '来自订单ID' },
                { field: 'created', width: 200, align: 'center', title: '添加时间' },
            ]]
        })
    })
</script>
</body>